package com.wyh.product.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/consul")
@RefreshScope
public class ConsulController {
    @Value("${service-name}")
    private String serviceName;

    @Value("${output.info}")
    private String outputInfo;

    @RequestMapping("getValue")
    public String getValue(){
        return "获取配置"+"{\n" + "service-name: " + serviceName + "\n"
        + "output.info: " + outputInfo + "\n" + "}";
    }

}
